<?php

session_start();
include_once($_SERVER['DOCUMENT_ROOT'] ."/include/user/inc.php");
include_once($_SERVER['DOCUMENT_ROOT'] ."/config/mblog_config.php");
include_once($_SERVER['DOCUMENT_ROOT'] ."/core/mblog/weibooauth.php");

if(!$_SESSION['last_key']['oauth_token'])
{
	header("location:/sina_api/?url=/love/index.php");
	exit;
}

$c = new WeiboClient( WB_AKEY , WB_SKEY , $_SESSION['last_key']['oauth_token'] , $_SESSION['last_key']['oauth_token_secret']  );
$ms  = $c->home_timeline(); // done
$me = $c->verify_credentials();



?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>微博求爱</title>
<script src="/js/jquery/jquery.js"></script>
</head>
<body>

求爱信息<textarea class="textarea_val"> @</textarea>
<input type="button" class="form_submit" value="">
<script>
$(".form_submit").bind("click",function(e){
alert($(".textarea_val").val());
var username = $(".textarea_val").val();
	$.ajax({
		url:"request_post.php",
		type:"post",
		data:"nick="+username,
		dataType:"json",
		complete:function(xhr,txtStatus){
			if(txtStatus == "success"){
				var result = eval("("+xhr.responseText+")");

				if(result.error == "0"){
					alert("success")	
				}else{
					alert(result.errmsg)	
				}
				
			}else{
				alert("request fail")	
			}
		}
	});

	
})
</script>
</body>
</html>

